<script type="text/javascript">

  var num = 123.234;
  var output = parseInt(num);
  console.log(output);
  console.log(typeof output);
  console.log('------------------');

  var num = "123.234";
  var output = parseFloat(num);
  console.log(output);
  console.log(typeof output);

  console.log('------------------');
  console.log('SHOW NUMBER WITH TWO  DECIMAL PLACES ');
  var num = 1234.56789;
  console.log(num.toFixed(2));

  console.log('------------------');
  console.log('STRING REPLACE ');
  var str = "Hello PHP in PHP";
  console.log(str.replace('PHP','JS'));

  console.log('------------------');
  console.log('STRING REPLACE ALL ');
  var str = "Hello PHP in PHP";
  console.log(str.replace(/PHP/g,'JS'));

  console.log('------------------');
  console.log('STRING TO ARRAY ');
  var str = "apple|orange|mango|banana";
  var arr = str.split('|');
  console.log(arr);

  console.log('------------------');
  console.log('ARRAY TO STRING ');
  var str = arr.join('*');
  console.log(str);

  console.log('------------------');
  console.log('ARRAY PARSING ');
  for(var i=0 ; i < arr.length ; i++){
    console.log(arr[i]);
  }



</script>
